package demo603;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Scanner;

public class ViewMain {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        System.out.println("欢迎来到此系统");
        System.out.println("请选择对应的操作");
        System.out.println("1.登录");
        System.out.println("2.注册");
        Scanner scanner = new Scanner(System.in);
        int i = scanner.nextInt();
        switch (i){
            case 1:
                System.out.println("请输入用户名：");
                String username = scanner.nextLine();
                System.out.println("请输入密码：");
                String password = scanner.nextLine();
                UserDao userDao = new UserDao();
                User user = userDao.findUser(username,password);
                if (user!=null){
                    System.out.println("登录成功！");
                }
                break;
                case 2:
                System.out.println("注册");
                username = scanner.nextLine();
               break;
        }
    }
}


